import Vue from 'vue';
import App from '@vue/app.vue';
import VueRouter from 'vue-router'; //载入路由
import routes from '@vue/router';//路由配置文件
import store from '@vue/store';//vuex
//rem
import 'lib-flexible/flexible';
//全局公共样式引入
import '@common/css/base.css';
import '@vue/style/public.less';
//连点处理
var FastClick = require('fastclick');
FastClick.attach(document.body);
//提示弹窗
import { Alert, Confirm, Toast, Loading } from 'wc-messagebox';
import 'wc-messagebox/style.css';
Vue.use(Alert);
Vue.use(Confirm);
Vue.use(Toast);
Vue.use(Loading);
//路由
Vue.use(VueRouter);
//全局组件注册
import Headers from "@vue/components/header.vue";
Vue.component('Headers', Headers);
const root = document.createElement('div');
document.body.appendChild(root);
const vue = new Vue({
  router: new VueRouter({
    // mode: 'history', // 去掉url中的#
    routes
  }),
  store,
  render: (h) => h(App),
  data: {
    eventHub: new Vue()
  }
}).$mount(root);
//导出vue实例
export default vue